<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title><?php echo ($title); ?></title>
    <link rel="stylesheet" href="/Public/web/css/pintuer.css">
    <link rel="stylesheet" href="/Public/web/css/admin.css">
    <script src="/Public/web/js/jquery.js"></script>
    <script src="/Public/web/js/pintuer.js"></script>
</head>


<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 门面管理</strong></div>
    <div class="padding border-bottom">
      <a class="button border-main icon-plus-square-o" href="<?php echo U('store/addStore');?>"> <?php echo L("tianjia");?></a>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="10%"><?php echo L("menmianmingcheng");?></th>
        <th width="20%"><?php echo L("menmiandizhi");?></th>
        <th width="10%"><?php echo L("menmiandianhua");?></th>
        <th width="10%"><?php echo L("menmianyouxiang");?></th>
        <th width="10%"><?php echo L("caozuo");?></th>
      </tr>
      <?php if(is_array($info)): foreach($info as $key=>$v): ?><tr class="o<?php echo ($v['s_id']); ?>">
          <td><?php echo ($v['store_name']); ?></td>
          <td><?php echo ($v['address']); ?></td>
          <td><?php echo ($v['tel']); ?></td>
          <td><?php echo ($v['email']); ?></td>
          <td>
            <div class="button-group">
              <a class="button border-main" href="<?php echo U('Store/editStore',array('id'=>$v['s_id']));?>"><span class="icon-edit"></span> <?php echo L("bianji");?></a>
              <a class="button border-red" href="javascript:void(0)" onclick="return del(<?php echo ($v['s_id']); ?>)"><span class="icon-trash-o"></span> <?php echo L("shanchu");?></a>
            </div>
          </td>
        </tr>
        <!--<?php if($v['sonlist']): ?>-->
          <!--<?php if(is_array($v['sonlist'])): foreach($v['sonlist'] as $key=>$v2): ?>-->
            <!--<tr style="background: #f0f0f0" class="o<?php echo ($v2['goods_cate_id']); ?> p<?php echo ($v2['p_id']); ?>">-->
              <!--<td><?php echo ($v2['sort']); ?></td>-->
              <!--<td><?php echo ($v['goods_cate_name']); ?> -&#45;&#45; <?php echo ($v2['goods_cate_name']); ?></td>-->
              <!--<td>-->
                <!--<span class="sp01" onclick="is_show(<?php echo ($v2['goods_cate_id']); ?>,this)">-->
                  <!--<?php if($v2['is_show'] == 1): ?>-->
                    <!--<img src="/Public/web/images/yes.png" width="18px;" >-->
                    <!--<?php else: ?>-->
                    <!--<img src="/Public/web/images/no.png" width="18px;" >-->
                  <!--<?php endif; ?>-->
                <!--</span>-->
              <!--</td>-->
              <!--<td>-->
                <!--<div class="button-group">-->
                  <!--<a class="button border-main" href="<?php echo U('Goodscate/edit',array('id'=>$v2['goods_cate_id']));?>"><span class="icon-edit"></span> <?php echo L("bianji");?></a>-->
                  <!--<a class="button border-red" href="javascript:void(0)" onclick="return del(<?php echo ($v2['goods_cate_id']); ?>)"><span class="icon-trash-o"></span> <?php echo L("shanchu");?></a>-->
                <!--</div>-->
              <!--</td>-->
            <!--</tr>-->
          <!--<?php endforeach; endif; ?>-->
        <!--<?php endif; ?>--><?php endforeach; endif; ?>
    </table>
  </div>
  <script type="text/javascript">
    function del(id){
      if(confirm("<?php echo L('shanchuxiaoxi');?>")){
        var url = "<?php echo U('Store/delStore');?>";
        $.getJSON(url,{id:id},function (data){
          if(data.result == 'tp1'){$(".o"+id).remove();}
          else if(data.result == 'break'){alert('ERROR.');}
        })
      }
    }
    function is_show(id,t){
      var url = "<?php echo U('Goodscate/is_show');?>";
      $.getJSON(url,{id:id},function (data){
        if(data.result == 'yes'){
          $(t).find('img').attr('src',"/Public/web/images/yes.png");
        }else if(data.result == 'no'){
          $(t).find('img').attr('src',"/Public/web/images/no.png");
        }
      })
    }
  </script>
</body>

</html>